package com.ficus.road.maintain.core.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * IdResult
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UrlResult implements Serializable {
    private static final long serialVersionUID = 1306062264840127390L;
    @JsonProperty("url")
    private String url;

    public UrlResult url(String url) {
        this.url = url;
        return this;
    }

    /**
     * 记录的唯一Id
     *
     * @return id
     */
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UrlResult idResult = (UrlResult) o;
        return Objects.equals(this.url, idResult.url);
    }

    @Override
    public int hashCode() {
        return Objects.hash(url);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UrlResultDTO {\n");

        sb.append("    Url: ").append(toIndentedString(url)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}

